import 'package:flutter_test/flutter_test.dart';
import 'package:printer_service/printer_service.dart';
import 'package:printer_service/printer_service_platform_interface.dart';
import 'package:printer_service/printer_service_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockPrinterServicePlatform
    with MockPlatformInterfaceMixin
    implements PrinterServicePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final PrinterServicePlatform initialPlatform = PrinterServicePlatform.instance;

  test('$MethodChannelPrinterService is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelPrinterService>());
  });

  test('getPlatformVersion', () async {
    PrinterService printerServicePlugin = PrinterService();
    MockPrinterServicePlatform fakePlatform = MockPrinterServicePlatform();
    PrinterServicePlatform.instance = fakePlatform;

    expect(await printerServicePlugin.getPlatformVersion(), '42');
  });
}
